package com.ee.chat.common.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ee.chat.common.entity.AdminRole;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * Mapper接口
 * </p>
 *
 * @author Shane
 * @since 2019-07-11
 */
public interface AdminRoleMapper extends BaseMapper<AdminRole> {
    /**
     * 获取角色列表
     * @Author Shane
     * @Date 2019/8/2815:03
     * @param
     * @return
     **/
    IPage<AdminRole> getAdminRoles(Page page);

    /**
     * 获取角色菜单功能id集合
     * @Author Shane
     * @Date 2019/7/24 2:05
     * @param
     * @return
     */
    List<Integer> getRoleMenuPermissionIds(@Param("roleId") Integer roleId);

    /**
     * 删除角色权限
     * @Author Shane
     * @Date 2019/7/24 2:26
     * @param
     * @return
     */
    int delRolePermissionByRoleId(@Param("roleId") Integer roleId);

    /**
     * 批量新增角色权限
     * @Author Shane
     * @Date 2019/7/24 2:28
     * @param
     * @return
     */
    int batchAddRolePermission(@Param("rolePermissions")List<Map<String, Object>> rolePermissions);
}